<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/vue.js"></script>
</head>
<body>
    <div id="app">
        <child :content="'hello world'"></child>
    </div>
    <script>
        Vue.component("child", {
            props: {
                content: {
                    type: String,//类型
                    required: false,//是否必传
                    default: "defaultValue",//默认值
                    validator: function (value) {//校验器函数
                        return value.length > 1
                    }
                }
            },
            template: "<div>{{content}}</div>"
        })
        let vm = new Vue({
            el:"#app",
            data: {

            }
        })
    </script>
</body>
</html>
